import { FormOption } from '@/types/form-common';
import {
  GAME_POSITION,
  ROUND_RESULT,
  HU_METHOD,
  MULTIPLE_NUM,
} from './game.config';

export enum SEX_VALUE {
  MALE = 'male',
  FEMALE = 'female',
}

/** 性别选项 */
export const SEX_OPTIONS: FormOption<SEX_VALUE>[] = [
  {
    value: SEX_VALUE.MALE,
    label: '男',
    key: SEX_VALUE.MALE,
  },
  {
    value: SEX_VALUE.FEMALE,
    label: '女',
    key: SEX_VALUE.FEMALE,
  },
];

/** 场风选项 */
export const POSITION_OPTIONS: FormOption<GAME_POSITION>[] = [
  {
    value: GAME_POSITION.EAST,
    label: '东风',
    key: '东风',
  },
  {
    value: GAME_POSITION.SOUTH,
    label: '南风',
    key: '南风',
  },
  {
    value: GAME_POSITION.WEST,
    label: '西风',
    key: '西风',
  },
  {
    value: GAME_POSITION.NORTH,
    label: '北风',
    key: '北风',
  },
];

/** 局数选项 */
export const SCENE_NUM_OPTIONS: FormOption<number>[] = (() => {
  return [1, 2, 3, 4].map(num => ({
    value: num,
    label: String(num),
    key: String(num),
  }));
})();

/** 本场数选项 */
export const COURT_NUM_OPTIONS: FormOption<number>[] = (() => {
  return [0, 1, 2, 3, 4, 5].map(num => ({
    value: num,
    label: String(num),
    key: String(num),
  }));
})();

/** 流局或和局选项 */
export const ROUND_RESULT_OPTIONS: FormOption<ROUND_RESULT>[] = [
  {
    label: '和局',
    value: ROUND_RESULT.HU,
    key: '和局',
  },
  {
    label: '流局',
    value: ROUND_RESULT.NO_HU,
    key: '流局',
  },
];

/** 流局或和局选项 */
export const HU_METHOD_OPTIONS: FormOption<HU_METHOD>[] = [
  {
    label: '自摸',
    value: HU_METHOD.ZIMO,
    key: '自摸',
  },
  {
    label: '荣和',
    value: HU_METHOD.RONG,
    key: '荣和',
  },
];

/** 翻数 */
export const MULTIPLE_OPTIONS: FormOption<MULTIPLE_NUM>[] = [
  {
    label: '一翻',
    value: MULTIPLE_NUM.MULTIPLE_ONE,
    key: '一翻',
  },
  {
    label: '两翻',
    value: MULTIPLE_NUM.MULTIPLE_TWO,
    key: '两翻',
  },
  {
    label: '三翻',
    value: MULTIPLE_NUM.MULTIPLE_THREE,
    key: '三翻',
  },
  {
    label: '四翻',
    value: MULTIPLE_NUM.MULTIPLE_FOUR,
    key: '四翻',
  },
  {
    label: '五翻(满贯)',
    value: MULTIPLE_NUM.SLAM,
    key: '五翻(满贯)',
  },
  {
    label: '六/七翻(跳满)',
    value: MULTIPLE_NUM.OVER_SLAM,
    key: '六/七翻(跳满)',
  },
  {
    label: '八/九/十翻(倍满)',
    value: MULTIPLE_NUM.DOUBLE_SLAM,
    key: '八/九/十翻(倍满)',
  },
  {
    label: '十一/十二翻(三倍满)',
    value: MULTIPLE_NUM.TRIPLE_SLAM,
    key: '十一/十二翻(三倍满)',
  },
  {
    label: '十三+(役满)',
    value: MULTIPLE_NUM.YAKUMAN,
    key: '十三+(役满)',
  },
];

/** 符数选项 */
export const SIGN_NUM_OPTIONS: FormOption<MULTIPLE_NUM>[] = [
  {
    label: '20',
    value: 20,
    key: '20',
  },
  {
    label: '25',
    value: 25,
    key: '25',
  },
  {
    label: '30',
    value: 30,
    key: '30',
  },
  {
    label: '40',
    value: 40,
    key: '40',
  },
  {
    label: '50',
    value: 50,
    key: '50',
  },
  {
    label: '60',
    value: 60,
    key: '60',
  },
  {
    label: '70',
    value: 70,
    key: '70',
  },
];
